package com.core.reach.cloudhub.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author ga.zhang
 * @version V1.0
 * @description: TODO
 * @date 2020/3/26 17:16
 **/
@Configuration
public class GatewayConfig {

    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder routeLocatorBuilder) {
        RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();
        /**https://voice.hupu.com/nba*/
        routes.route("path_route_core_first",r -> r.path("/nba").uri("https://voice.hupu.com/nba")).build();
        return routes.build();
    }

}
